﻿@{
    var sectionList = (ICollection<Coevery.FormDesigner.Models.Section>)ViewData["Layout"];
}

@foreach (var layoutSection in sectionList) {
    <fd-section section-columns="@layoutSection.SectionColumns" section-columns-width="@layoutSection.SectionColumnsWidth" section-title="@layoutSection.SectionTitle">
        @foreach (var row in layoutSection.Rows) {
            <fd-row @if (row.IsMerged) { <text>class="merged-row"</text> }>
                @foreach (var column in row.Columns) {
                    <fd-column>
                        @if (column.Field != null && column.Field.IsValid) {
                            <fd-field field-name="@column.Field.FieldName"></fd-field>
                        }
                    </fd-column>
                }
            </fd-row>
        }
    </fd-section>
}
